package com.wtone.platform.gat.images.gat.service.impl;

import cn.hutool.core.convert.Convert;
import com.wtone.platform.gat.images.gat.entity.Subscribenotifications;
import com.wtone.platform.gat.images.gat.mapper.SubscribenotificationsMapper;
import com.wtone.platform.gat.images.gat.service.ISubscribenotificationsService;
import com.wtone.platform.gat.images.gat.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: aiLin
 * @date: 2020-09-29
 * @desc: 通知记录Service业务层处理
 */
@Service
public class SubscribenotificationsServiceImpl implements ISubscribenotificationsService
{
    @Autowired
    private SubscribenotificationsMapper subscribenotificationsMapper;

    /**
     * 查询通知记录
     * 
     * @param id 通知记录ID
     * @return 通知记录
     */
    @Override
    public Subscribenotifications selectSubscribenotificationsById(String id)
    {
        return subscribenotificationsMapper.selectSubscribenotificationsById(id);
    }

    /**
     * 查询通知记录列表
     * 
     * @param subscribenotifications 通知记录
     * @return 通知记录
     */
    @Override
    public List<Subscribenotifications> selectSubscribenotificationsList(Subscribenotifications subscribenotifications)
    {
        return subscribenotificationsMapper.selectSubscribenotificationsList(subscribenotifications);
    }

    /**
     * 新增通知记录
     * 
     * @param subscribenotifications 通知记录
     * @return 结果
     */
    @Override
    public int insertSubscribenotifications(Subscribenotifications subscribenotifications)
    {
        subscribenotifications.setCreateTime(DateUtils.getNowDate());
        return subscribenotificationsMapper.insertSubscribenotifications(subscribenotifications);
    }

    /**
     * 修改通知记录
     * 
     * @param subscribenotifications 通知记录
     * @return 结果
     */
    @Override
    public int updateSubscribenotifications(Subscribenotifications subscribenotifications)
    {
        subscribenotifications.setUpdateTime(DateUtils.getNowDate());
        return subscribenotificationsMapper.updateSubscribenotifications(subscribenotifications);
    }

    /**
     * 删除通知记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSubscribenotificationsByIds(String ids)
    {
        return subscribenotificationsMapper.deleteSubscribenotificationsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除通知记录信息
     * 
     * @param id 通知记录ID
     * @return 结果
     */
    public int deleteSubscribenotificationsById(String id,String notificationid)
    {
        return subscribenotificationsMapper.deleteSubscribenotificationsById(id,notificationid);
    }
}
